﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Windows.Forms;

namespace CandooMwrf
{
    static class Program
    {
        private static Mutex onlyOne;

        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            onlyOne = new Mutex(true, Process.GetCurrentProcess().ProcessName);
            if (onlyOne.WaitOne(0, false))
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                //Application.Run(new FrmTest());
#if DEBUG
                //MessageBox.Show("温馨提示：您正运行于DEBUG模式");
#else
        
#endif

#if DEBUG
        Application.Run(new MainForm());
                
#else
                var login = new frmLogin();
                login.ShowDialog();
                if(login.IsLogin)
                    Application.Run(new MainForm());
#endif
            }
            else
            {
                MessageBox.Show("应用程序已启动！");
                Application.Exit();
            }
        }
    }
}
